<?xml version="1.0" encoding="utf-8" ?> 
<sqlMap namespace="OrderDetailMen"
	xmlns="http://ibatis.apache.org/mapping" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<alias>
		<typeAlias alias="OrderDetailMen" type="Domain.OrderDetailMen" />
	</alias>

	<resultMaps>
		<resultMap id="FullResultMap" class="OrderDetailMen">
			<result property="id" column="id" dbType="Int"/>
			<result property="orderId" column="orderId" dbType="Int"/>
			<result property="name" column="name" dbType="NVarChar"/>
			<result property="guiGeGao" column="guiGeGao" dbType="Decimal"/>
			<result property="guiGeKuan" column="guiGeKuan" dbType="Decimal"/>
			<result property="guiGeShen" column="guiGeShen" dbType="Decimal"/>
			<result property="menXingHao" column="menXingHao" dbType="NVarChar"/>
			<result property="menJian" column="menJian" dbType="NVarChar"/>
			<result property="kaiQiFangXiang" column="kaiQiFangXiang" dbType="NVarChar"/>
			<result property="danShuangKou" column="danShuangKou" dbType="NVarChar"/>
			<result property="jiCaiMen" column="jiCaiMen" dbType="NVarChar"/>
			<result property="jiCaiKuangBan" column="jiCaiKuangBan" dbType="NVarChar"/>
			<result property="jiCaiKouXian" column="jiCaiKouXian" dbType="NVarChar"/>
			<result property="kouXianXianXing" column="kouXianXianXing" dbType="NVarChar"/>
			<result property="hengKouXianXianKuan" column="hengKouXianXianKuan" dbType="Decimal"/>
			<result property="hengKouXianShuLiang" column="hengKouXianShuLiang" dbType="Int"/>
			<result property="hengKouXian1XianKuan" column="hengKouXian1XianKuan" dbType="Decimal"/>
			<result property="hengKouXian1ShuLiang" column="hengKouXian1ShuLiang" dbType="Int"/>
			<result property="liKouXianXianKuan" column="liKouXianXianKuan" dbType="Decimal"/>
			<result property="likouxianshuliang" column="likouxianshuliang" dbType="Int"/>
			<result property="likouxian1xiankuan" column="likouxian1xiankuan" dbType="Decimal"/>
			<result property="likouxian1shuliang" column="likouxian1shuliang" dbType="Int"/>
			<result property="likouxian2xiankuan" column="likouxian2xiankuan" dbType="Decimal"/>
			<result property="likouxian2shuliang" column="likouxian2shuliang" dbType="Int"/>
			<result property="shangmao" column="shangmao" dbType="NVarChar"/>
			<result property="youqileixing" column="youqileixing" dbType="NVarChar"/>
			<result property="youqiyansemen" column="youqiyansemen" dbType="NVarChar"/>
			<result property="youqiyansekuangban" column="youqiyansekuangban" dbType="NVarChar"/>
			<result property="youqiyansekouxian" column="youqiyansekouxian" dbType="NVarChar"/>
			<result property="suoju" column="suoju" dbType="NVarChar"/>
			<result property="jiage" column="jiage" dbType="Decimal"/>
			<result property="dinggoushuliang" column="dinggoushuliang" dbType="Int"/>
      <result property="mupi" column="mupi" dbType="VarChar"/>
		</resultMap>
	</resultMaps>
	
	<statements>

		<select id="GetCount" resultClass="System.Int32">
			SELECT count(*) FROM [dbo].[orderDetailMen]
		</select>
		
		<select id="GetCountByCondition" parameterClass="Hashtable" resultClass="System.Int32" extends="GetCount">
			WHERE $condition$
		</select>
		
		<select id="FindAll" resultClass="OrderDetailMen">
			SELECT * 
			FROM [dbo].[orderDetailMen]
		</select>
		
		<select id="GetModel" parameterClass="OrderDetailMen" resultClass="OrderDetailMen" extends="FindAll">
			WHERE
				([orderDetailMen].[id] = #id,dbType=Int#)
		</select>

		<insert id="Insert" parameterClass="OrderDetailMen">
      INSERT INTO [dbo].[orderDetailMen] (

      [orderId] ,
      [name] ,
      [guiGeGao] ,
      [guiGeKuan] ,
      [guiGeShen] ,
      [menXingHao] ,
      [menJian] ,
      [kaiQiFangXiang] ,
      [danShuangKou] ,
      [jiCaiMen] ,
      [jiCaiKuangBan] ,
      [jiCaiKouXian] ,
      [kouXianXianXing] ,
      [hengKouXianXianKuan] ,
      [hengKouXianShuLiang] ,
      [hengKouXian1XianKuan] ,
      [hengKouXian1ShuLiang] ,
      [liKouXianXianKuan] ,
      [likouxianshuliang] ,
      [likouxian1xiankuan] ,
      [likouxian1shuliang] ,
      [likouxian2xiankuan] ,
      [likouxian2shuliang] ,
      [shangmao] ,
      [youqileixing] ,
      [youqiyansemen] ,
      [youqiyansekuangban] ,
      [youqiyansekouxian] ,
      [suoju] ,
      [jiage] ,
      [dinggoushuliang],
      [mupi]
      ) VALUES (

      #orderId,dbType=Int# ,
      #name,dbType=NVarChar# ,
      #guiGeGao,dbType=Decimal# ,
      #guiGeKuan,dbType=Decimal# ,
      #guiGeShen,dbType=Decimal# ,
      #menXingHao,dbType=NVarChar# ,
      #menJian,dbType=NVarChar# ,
      #kaiQiFangXiang,dbType=NVarChar# ,
      #danShuangKou,dbType=NVarChar# ,
      #jiCaiMen,dbType=NVarChar# ,
      #jiCaiKuangBan,dbType=NVarChar# ,
      #jiCaiKouXian,dbType=NVarChar# ,
      #kouXianXianXing,dbType=NVarChar# ,
      #hengKouXianXianKuan,dbType=Decimal# ,
      #hengKouXianShuLiang,dbType=Int# ,
      #hengKouXian1XianKuan,dbType=Decimal# ,
      #hengKouXian1ShuLiang,dbType=Int# ,
      #liKouXianXianKuan,dbType=Decimal# ,
      #likouxianshuliang,dbType=Int# ,
      #likouxian1xiankuan,dbType=Decimal# ,
      #likouxian1shuliang,dbType=Int# ,
      #likouxian2xiankuan,dbType=Decimal# ,
      #likouxian2shuliang,dbType=Int# ,
      #shangmao,dbType=NVarChar# ,
      #youqileixing,dbType=NVarChar# ,
      #youqiyansemen,dbType=NVarChar# ,
      #youqiyansekuangban,dbType=NVarChar# ,
      #youqiyansekouxian,dbType=NVarChar# ,
      #suoju,dbType=NVarChar# ,
      #jiage,dbType=Decimal# ,
      #dinggoushuliang,dbType=Int#,
      #mupi,dbType=NVarChar#
      )
    </insert>

		<update id="Update" parameterClass="OrderDetailMen">
      UPDATE [dbo].[orderDetailMen] SET
      [orderId] = #orderId,dbType=Int#
      , [name] = #name,dbType=NVarChar#
      , [guiGeGao] = #guiGeGao,dbType=Decimal#
      , [guiGeKuan] = #guiGeKuan,dbType=Decimal#
      , [guiGeShen] = #guiGeShen,dbType=Decimal#
      , [menXingHao] = #menXingHao,dbType=NVarChar#
      , [menJian] = #menJian,dbType=NVarChar#
      , [kaiQiFangXiang] = #kaiQiFangXiang,dbType=NVarChar#
      , [danShuangKou] = #danShuangKou,dbType=NVarChar#
      , [jiCaiMen] = #jiCaiMen,dbType=NVarChar#
      , [jiCaiKuangBan] = #jiCaiKuangBan,dbType=NVarChar#
      , [jiCaiKouXian] = #jiCaiKouXian,dbType=NVarChar#
      , [kouXianXianXing] = #kouXianXianXing,dbType=NVarChar#
      , [hengKouXianXianKuan] = #hengKouXianXianKuan,dbType=Decimal#
      , [hengKouXianShuLiang] = #hengKouXianShuLiang,dbType=Int#
      , [hengKouXian1XianKuan] = #hengKouXian1XianKuan,dbType=Decimal#
      , [hengKouXian1ShuLiang] = #hengKouXian1ShuLiang,dbType=Int#
      , [liKouXianXianKuan] = #liKouXianXianKuan,dbType=Decimal#
      , [likouxianshuliang] = #likouxianshuliang,dbType=Int#
      , [likouxian1xiankuan] = #likouxian1xiankuan,dbType=Decimal#
      , [likouxian1shuliang] = #likouxian1shuliang,dbType=Int#
      , [likouxian2xiankuan] = #likouxian2xiankuan,dbType=Decimal#
      , [likouxian2shuliang] = #likouxian2shuliang,dbType=Int#
      , [shangmao] = #shangmao,dbType=NVarChar#
      , [youqileixing] = #youqileixing,dbType=NVarChar#
      , [youqiyansemen] = #youqiyansemen,dbType=NVarChar#
      , [youqiyansekuangban] = #youqiyansekuangban,dbType=NVarChar#
      , [youqiyansekouxian] = #youqiyansekouxian,dbType=NVarChar#
      , [suoju] = #suoju,dbType=NVarChar#
      , [jiage] = #jiage,dbType=Decimal#
      , [dinggoushuliang] = #dinggoushuliang,dbType=Int#
      , [mupi] = #mupi,dbType=NVarChar#
      WHERE
      ([id] = #id,dbType=Int#)
    </update>

		<delete id="Delete" parameterClass="OrderDetailMen">
			DELETE FROM [dbo].[orderDetailMen]
			WHERE
				([id] = #id,dbType=Int#)
		</delete>

		<select id="GetModelsByCondition" parameterClass="Hashtable" resultClass="OrderDetailMen">
			SELECT $columnNames$ FROM [dbo].[orderDetailMen] where $condition$
		</select>
		
		<select id="GetModelsByConditionByPager" parameterClass="Hashtable" resultClass="OrderDetailMen">
			SELECT * FROM 
			(select $columnNames$,row_number() over(order by $orderBy$) as rno from [dbo].[orderDetailMen] where $condition$) t 
			<![CDATA[
			where t.rno>#startNo# and t.rno<=#endNo#
			]]>
		</select>
		
	</statements>
</sqlMap>
